package com.vocabulary.util;

import com.vocabulary.service.VocabularyEstimator;
import java.util.List;

public class VocabularyResultFormatter {
    
    public static String formatWordList(List<VocabularyEstimator.WordResponse> responses) {
        StringBuilder sb = new StringBuilder();
        for (VocabularyEstimator.WordResponse response : responses) {
            sb.append(response.getWord().getWord())
              .append("，")
              .append(response.isCorrect() ? "认识" : "不认识")
              .append("；\n");
        }
        return sb.toString();
    }
    
    public static String formatResult(VocabularyEstimator.VocabularyEstimate estimate) {
        return String.format(
            "估算词汇量：%,d 个单词\n" +
            "置信区间：%,d - %,d\n" +
            "正确率：%.1f%%",
            estimate.getEstimatedSize(),
            estimate.getConfidenceInterval().getLowerBound(),
            estimate.getConfidenceInterval().getUpperBound(),
            estimate.getCorrectRate() * 100
        );
    }
} 